# vim: ai ts=2 sts=2 et sw=2

import os
import pygame

def load_image(imageName):
  "load an image and return a Surface"
  fullPath = os.path.join("data", "images", imageName)

  try:
    image = pygame.image.load(fullPath)
    if image.get_alpha() is None:
      image = image.convert()
    else:
        image = image.convert_alpha()

  except pygame.error, message:
    print "Cannot load image: %s" % (fullPath)
    raise SystemExit, message

  return image
